<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<script type="text/javascript">
	function c(obj){
		var status=	$(obj).parent().parent().next().next().next();
		if(status.text()!='待审核'){
		alertMsg.warn('只能选择待审核的');
		$(obj).attr('checked',false);
		}
		
		
	}
</script>
<form id="pagerForm" method="post" action="allocaterequest/findrequest.do">
	<input type="hidden" name="pageNum" value="${requestScope.condition.pageNum}" />
	<input type="hidden" name="numPerPage" value="${requestScope.condition.numPerPage}" />
	<input type="hidden" name="request_deptid" value="${requestScope.condition.request_deptid}" />
	<input type="hidden" name="code" value="${requestScope.condition.code}" />
	<input type="hidden" name="request_time" value="${requestScope.condition.request_time}" />
	<input type="hidden" name="operator" value="${requestScope.condition.operator}" />
</form>
<div class="pageHeader">
	<form onsubmit="return navTabSearch(this);" action="allocaterequest/findrequest.do" method="post">
	
	<div class="searchBar">
		<table class="searchContent">
			<tr>
				<td>
					调拨申请流水号：<input type="text" name="code"  value="${requestScope.condition.code}"/>
				</td>
				<td>
				申请时间：<input type="text" name="request_time" class="date"  value="${requestScope.condition.request_time}"/>
				</td>
				<td>
					申请部门：<input class="required" bringbackname="district.deptname" name="request_deptid" type="text" value="${requestScope.condition.request_deptid}" readonly/>
				</td>
				<td>
				<a class="btnLook" href="<%=basePath%>dept/showtree.do" lookupGroup="district">查找带回</a>	
				</td>
				<td>
					申请人：<input type="text" name="operator"  value="${requestScope.condition.operator}"/>
				</td>
			</tr>
		</table>
		<div class="subBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">查询</button></div></div></li>
			</ul>
		</div>
	</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
		<li><a class="add" href="allocaterequest/requestpop.do" target="dialog" mask="true" rel="submit" title="提交申请" ><span>提交申请</span></a></li>
		<li><a class="delete" href="allocaterequest/acceptrequest.do" target="selectedTodo" rel="ids" title="确定要接收吗?"><span>接收</span></a></li>
	
		<li class="line">line</li>
		<li><a class="icon" href="allocaterequest/refuserequest.do" target="selectedTodo" rel="ids" title="确定要拒绝吗?"><span>拒绝</span></a></li>
		</ul>
	</div>
	<table class="table" width="100%" layoutH="138">
		<thead>
			<tr>
				<th width="20"></th>
				<th width="20"></th>
				<th width="100">申请时间</th>
				<th>申请人</th>
				<th width="100">状态</th>
				<th width="50">申请部门</th>
				<th width="80" align="center">原部门</th>
				<th width="80">目标部门</th>
				<th width="80">流水号</th>
				
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${requestScope.lsit }" var="allocate" varStatus="status">
				<tr>
				<td>${status.index+1 }</td>
				<td><input type="checkbox" name="ids" value="${allocate.id}" onclick="c(this)"></td>
				<td>${allocate.request_time}</td>
				<td>${allocate.operator}</td>
				<c:if test="${allocate.status ==0}"><td>待审核</td></c:if>
				<c:if test="${allocate.status ==1}"><td>接收</td></c:if>
				<c:if test="${allocate.status ==2}"><td>拒绝</td></c:if>
				<td>${allocate.request_deptid}</td>
				<td>${allocate.from_dept}</td>
				<td>${allocate.to_dept}</td>
				<td>${allocate.code}</td>
				</tr>
			</c:forEach>
			
		</tbody>
	</table>
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
				<option value="10">10</option>
				<option value="20">20</option>
				<option value="50">50</option>
			</select>
			<span>条，共${requestScope.condition.totalCount}条</span>
		</div>
		
		<div class="pagination" targetType="navTab" totalCount="${requestScope.condition.totalCount}" numPerPage="${requestScope.condition.numPerPage}" pageNumShown="5" currentPage="${requestScope.condition.pageNum}"></div>
	</div>

	</div>

